#include "iostream"
#include "stdlib.h"
using namespace std;
// sequence list

#define MaxSize 10
#define InitSize 10

struct ElemType{
	int n;
	ElemType *next;
};

typedef struct DLNode{
	ElemType data;
	DLNode* next;
	DLNode* prior;
}DLNode,*DLinkList;

bool initDLinkList(DLinkList &L);
bool insert(DLNode *p,DLNode *s);
bool del(DLNode *p);
void Destory(DLinkList &L);
void printDLinkList(DLinkList &L);

int main(){
	DLinkList L;
	initDLinkList(L);
	return 0;
}


bool initDLinkList(DLinkList &L){
	L = (DLNode*)malloc(sizeof(DLNode))；
	if(L==NULL)
		return false;
	L->next = NULL;
	L->prior = NULL;
	return true;
}

bool insert(DLNode *p,DLNode *s){
	s->next = p->next;
	s->prior = p;
	p->next->prior = s;
	p->next = s;
}

bool del(DLNode *p){
	DLNode * q = p;
	if(p==NULL) 
		return false;
	p->prior->next = p->next;
	if(p->next!=NULL)
		p->next->prior = p->prior;
	free(q);
	return true;
}
bool delNext(DLNode *p){
	DLNode * q = p->next;
	if(q==NULL) 
		return false;
	p->next = q->next;
	if(p->next!=NULL)
		q->next->prior = p;
	free(q);
	return true;
}

void Destory(DLinkList &L){
	while(L->next!=NULL)
		delNext(L);
	free(L);
	L=NULL;
}